var aValueIndicators = [];
function CallbackValueIndicators(oServerObjects) {
  while(aValueIndicators.length > 0) {
    map.removeOverlay(aValueIndicators.pop());
  }
  
  for(i = 0; i < oServerObjects.length; i++) {
    var oServerObject = oServerObjects[i];
    aValueIndicators.push(CreateMapMarker(map, oServerObject.url, oServerObject.radius * 2, oServerObject.radius * 2, oServerObject.point.t, oServerObject.point.g, oServerObject.description, null, 2, null, null));
  }
}

function ValueIndicatorsUpdate(oMap, sUrl, oValueIndicators, sCaller) {
  var request = GXmlHttp.create();
  request.open("POST", sUrl, true);
  request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
  oMap.disableEvents();
  oMap.addControl(oMap.loadingControl);
 
  request.onreadystatechange = function(){
    if (request.readyState == 4 && request.status == 200) {
      if (request.responseText) {
        var oResponse = null;
        try {
          oResponse = eval(request.responseText);
        } catch(err) {
          document.write(request.responseText);
        }
        oMap.removeControl(oMap.loadingControl);
        oMap.enableEvents();

        if (oResponse != null)
          CallbackValueIndicators(oResponse);
      }
    }
  }
  
  request.send('data=' + oValueIndicators +
   '&zoom=' + oMap.getZoom() + 
   '&swLat=' + escape(oMap.getBounds().getSouthWest().lat()) +
   '&swLng=' + escape(oMap.getBounds().getSouthWest().lng()) +
   '&neLat=' + escape(oMap.getBounds().getNorthEast().lat()) +
   '&neLng=' + escape(oMap.getBounds().getNorthEast().lng())
 );
}


